home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Magazin/MacEasy 27
/
Mac Magazin and MacEasy Magazine CD - Issue 27.iso
/
Grafik & Text
/
Sans-Faute⁄Grammaire ƒ
/
Adaptateurs
/
Sources des scripts (anglais)
/
Vérification FrameMaker®
next >
Wrap
Text File
|
1996-02-20
|
1KB
|
43 lines
set kMaxCheckingSFG to 32000 -- max number of characters that Sans-Faute/Grammaire can check
tell application "FrameMaker5"
set FrontDocPresent to exists front document
end tell
if FrontDocPresent then
tell application "FrameMaker5"
set nbStory to count text flows of front document
end tell
-- loop on each story
repeat with storyIdx from 1 to nbStory
tell application "FrameMaker5"
set storySize to count character of text flow storyIdx of front document
end tell
if storySize > 0 then -- do something only for non null stories
tell application "FrameMaker5"
set nbParagraph to count paragraph of text flow storyIdx of front document
end tell
repeat with paragraphIdx from 1 to nbParagraph
tell application "FrameMaker5"
set paragraphSize to count character of paragraph paragraphIdx of text flow storyIdx of front document
end tell
if paragraphSize > kMaxCheckingSFG then
display dialog "Le paragraphe " & paragraphIdx & " du bloc " & storyIdx & " dépasse 32000 caractères. Sans-Faute/Grammaire ne peut pas le vérifier !"
else
set objToCheck to {a reference to paragraph paragraphIdx of text flow storyIdx of front document}
tell application "Sans-Faute/Grammaire 2"
Checking objToCheck ClientAddress Application "FrameMaker5"
end tell
end if
end repeat
end if
end repeat
else
display dialog "Aucun document n'est ouvert dans FrameMaker"
end if